package com.ross.mode.service.impl;

import com.alibaba.fastjson.JSON;
import com.ross.mode.service.UserService;
import lombok.extern.slf4j.Slf4j;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @version 1.0.0
 * @className: UserServiceImpl
 * @description:
 * @author: zhangjunfa
 * @date: 2023/3/31 9:55
 */
@Slf4j
public class UserServiceImpl implements UserService {

    private Map<String, Object> cacheMap = new ConcurrentHashMap<String, Object>();

    public void addUser(String id, String name) {
        log.info("添加用户,主键ID：{}，名字：{}", id, name);
        cacheMap.put(id, name);
    }

    public Object getUserById(String id) {
        log.info("获取用户名称：{}", id);
        return cacheMap.get(id);
    }
}
